<?php
if( $_SERVER['HTTP_REFERER'] == "" )
{
exit;
}
include("config.php");
date_default_timezone_set('Asia/Shanghai');
$dat=date("Y-m-d H:i:s");
$str=$_GET['val'];
$iss=$_GET['iss'];
$sqls="insert into records (issueid,num,year) values ('$iss','$str','$dat') ";
$results=$mysqli->query($sqls);
$sql1="select * from records ";
$result1=$mysqli->query($sql1);
$sql="select  a.num,count(*) as ci from (select  id,num from records order by id desc LIMIT 0, 100) as a group by a.num";
$result=$mysqli->query($sql);
if($result1->num_rows){
while($field=$result->fetch_object()){
echo "<div class='issues'>数字：".$field->num;
echo "，出现次数：".$field->ci."</div>";
}
}else{
    echo "没有数据";
}

$mysqli->close();
//echo json_encode($data,JSON_UNESCAPED_UNICODE); 
//echo json_encode($data1,JSON_UNESCAPED_UNICODE); 
?>